package lession2.PartA_Grammar.impl

fun main(){
    open class Shape
    class Rectangle: Shape()
    fun Shape.getName() = "Shape"
    fun Rectangle.getName() = "Rectangle"
    fun printClassName(s: Shape) {
        println(s.getName())
    }
    printClassName(Rectangle())
}

class TestClass1 :InterfaceA,InterfaceB {
    //为初始化的字段 会提醒你重写进行初始化该值
    override val prop: Int
        get() = TODO("Not yet implemented")

    override fun hello() {
        super<InterfaceA>.hello()
        super<InterfaceB>.hello()
    }


}
val <T> List<T>.lastIndex: Int
    get() = size - 1